/*******************************************************************************
 * Copyright(c) 2023 Levetop Semiconductor Co.,Led. All rights reserved.
 * @file     gif.h
 * @author   UartTFT Application Team
 * @version  V0.0.1
 * @date     2023-01-11
 * @brief    This file provides UartTFT Application display function
 ********************************************************************************/

#ifndef GIF_H_
#define GIF_H_

#include "type.h"
#include "module_select.h"

/*gif*/
extern uint8_t Gif_num;
extern uint8_t Gif_flag;
typedef struct
{
	uint32_t addr;
	uint32_t total;
	uint16_t p_add;
	uint16_t x; // x,y of screen
	uint16_t y;
	uint16_t w;
	uint16_t h;
	uint16_t gif_id;
	uint16_t reset_En; // 0x0000:When stopping, the start value of the animation icon is not reset (the animation icon displays from any value between ICON_Start and ICON_End).
					   // 0x0001:When stopping, the start value of the animation icon will be reset (the animation icon display will be fixed from ICON_Start).
	uint8_t t_d; // Frame time interval
	uint8_t t_c; // Record time
	uint16_t p_c;
	uint16_t V_stop;  // The fixed icon is displayed when the variable is at this value.
	uint16_t V_start; // The animated icon is automatically displayed when the variable is this value.
	uint16_t V_once;  // play only once
	uint8_t mode;
	uint8_t flag;
	uint16_t var_addr[8];
	uint16_t var[8];
	uint8_t omode;
	uint16_t overlay;
} Gif_Info;

extern Gif_Info gGif_Info[GIF_SIZE];
extern uint8_t Gif_num;
extern uint8_t Gif_flag;


void show_gif(void);
void gif_display(uint8_t type, uint8_t *buff);
uint8_t LT_ShowGifPicture(uint8_t num);
void gif_overlay_update(uint16_t id,uint8_t num);
#endif /* GIF_H_ */
